package com.example.tests;

public class ContactData implements Comparable<ContactData>{
	public String name;
	public String surname;
	public String address;
	public String homePhone;
	public String mobilePhone;
	public String workPhone;
	public String email;
	public String email2;
	public String birthDay;
	public String birthMonth;
	public String birthYear;
	public String contactGroup;

	public ContactData() {
		
	}
	
	public ContactData(String contactName, String contactSurname,
			String address, String homePhone, String mobilePhone,
			String workPhone, String email, String email2, String birthDay,
			String birthMonth, String birthYear, String contactGroup) {
		this.name = contactName;
		this.surname = contactSurname;
		this.address = address;
		this.homePhone = homePhone;
		this.mobilePhone = mobilePhone;
		this.workPhone = workPhone;
		this.email = email;
		this.email2 = email2;
		this.birthDay = birthDay;
		this.birthMonth = birthMonth;
		this.birthYear = birthYear;
		this.contactGroup = contactGroup;
	}

	@Override
	public String toString() {
		return "ContactData [name=" + name + ", surname=" + surname + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
//		result = prime * result + ((name == null) ? 0 : name.hashCode());
//		result = prime * result + ((surname == null) ? 0 : surname.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (surname == null) {
			if (other.surname != null)
				return false;
		} else if (!surname.equals(other.surname))
			return false;
		return true;
	}

	@Override
	public int compareTo(ContactData other) {
		return this.name.toLowerCase().compareTo(other.name.toLowerCase());
	}
	
	
	
	
}